
from multiprocessing.dummy import Pool
def multithread(cl,map_args,pool_num=1):
    pool_num = pool_num if len(map_args) > pool_num else len(map_args)
    if pool_num == 0:
        return
    pool = Pool(pool_num)
    results = pool.map(cl,map_args)
    pool.close()
    pool.join()
    for rs in results:
        yield rs